# Author 阳某
from jicao import copy

names = ["A","B","C","D","@","1","$","j","B"]
names.append("E")#末尾增加
names.insert(1,"F")
names.insert(3,"G")
names[0] = "a"
#names.remove("G")
#names.pop()#默认删除最后一位，，，输入下标则不同=del names[x]
del names[0]
#names.clear()#q清除列表
#del names    #删除变量
names.sort()#根据ASCII表排序
print(names)
print(names.index("B"))#即使重复了也只会打印第一次出现的位置
print(names[names.index("B")])
print(names.count("B"))#计算某元素出现的次数
names.reverse()#翻转列表
print(names)
names2 = ["5","8","6"]
names.extend(names2)
print(names,names2)
print("*****************")
names.insert(3,["abc","jack"])
# names3 = names.copy()#浅复制
# names3 = names
# names3 = copy.copy(names)#浅copy
names3 = copy.deepcopy(names)#深copy
print(names)
print(names3)
names[5] = "我爱你"
names[3][0] = "ABCDTG"
print(names)
print(names3)
#range(1,10,2)
print(names[0:-1:2])
print(names[::2])#0和-1课省略
print("*****************************")
for i in names:
    print(i)
# print(names[0])
# print(names[0:2])#顾头不顾尾*****0代表从0开始
# print(names[:2])#顾头不顾尾
# print(names[1:3])#切片
# print(names[3])
# print(names[-1])#切片 ***最后一个
# print(names[-2])#切片  *****倒数第二个
# print(names[-3:-1])#切片
# print(names[-3:])#切片   **省略最后一个的位置


a = [1,2,3]
b = a
a[1] = 555
b = [1,555,3]
